package com.fan.analysis.config;

import com.fan.analysis.interceptor.IncompleteDataInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * URL路由配置
 *
 * @author fan
 * @date 2021/09/20 12:56
 **/
@Configuration
public class IncompleteDataWebAppConfig implements WebMvcConfigurer {

    @Autowired
    private IncompleteDataInterceptor incompleteDataInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(incompleteDataInterceptor).addPathPatterns("/**");
    }

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

        registry.addViewController("/").setViewName("index");
        registry.addViewController("/index").setViewName("index");
        registry.addViewController("/index.html").setViewName("index");
        registry.addViewController("/home_page").setViewName("index");

        registry.addViewController("/BasicCall_list").setViewName("BasicCall-list");
        registry.addViewController("/BasicMessage_list").setViewName("BasicMessage-list");
        registry.addViewController("/data_mix").setViewName("data-mix");
        registry.addViewController("/total_info").setViewName("total_info");
        registry.addViewController("/Call_list").setViewName("Call-list");
        registry.addViewController("/Message_list").setViewName("Message-list");
        registry.addViewController("/user_relation").setViewName("user-relation");
        registry.addViewController("/user_charactor").setViewName("user-charactor");
        registry.addViewController("/group_info").setViewName("group_info");
        registry.addViewController("/key_user").setViewName("key_user");
        registry.addViewController("/group_label").setViewName("group_label");
        registry.addViewController("/min_gan_yu_jing").setViewName("MinGanYuJing");


        registry.addViewController("/404").setViewName("404");


    }
}
